﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 2.6
// Code is generated on: 02 November 2012 16:44:35
// Code is generated using templates: SD.TemplateBindings.SqlServerSpecific.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.Data;
using System.Data.SqlClient;

using NetDon.OA.Data.HelperClasses;

using SD.LLBLGen.Pro.ORMSupportClasses;

namespace NetDon.OA.Data.StoredProcedureCallerClasses
{
	/// <summary>
	/// Class which contains the static logic to execute retrieval stored procedures in the database.
	/// </summary>
	public partial class RetrievalProcedures
	{
		/// <summary>
		/// private CTor so no instance can be created.
		/// </summary>
		private RetrievalProcedures()
		{
		}

	
		/// <summary>
		/// Calls stored procedure 'QueryIssuingOrder'.<br/><br/>
		/// 
		/// </summary>
		/// <param name="orderCode">Input parameter of stored procedure</param>
		/// <param name="customerId">Input parameter of stored procedure</param>
		/// <param name="transportationPlanCode">Input parameter of stored procedure</param>
		/// <param name="orderStatus">Input parameter of stored procedure</param>
		/// <param name="routeTypeId">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateStart">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateEnd">Input parameter of stored procedure</param>
		/// <param name="goodsShippedTypeId">Input parameter of stored procedure</param>
		/// <param name="deliveryCity">Input parameter of stored procedure</param>
		/// <param name="areaId">Input parameter of stored procedure</param>
		/// <returns>Filled DataTable with resultset(s) of stored procedure</returns>
		public static DataTable QueryIssuingOrder(System.String orderCode, System.Guid customerId, System.String transportationPlanCode, System.Int32 orderStatus, System.Guid routeTypeId, System.DateTime receivingOrderDateStart, System.DateTime receivingOrderDateEnd, System.Guid goodsShippedTypeId, System.String deliveryCity, System.Guid areaId)
		{
			// create parameters
			SqlParameter[] parameters = new SqlParameter[10];
			parameters[0] = new SqlParameter("@OrderCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, orderCode);
			parameters[1] = new SqlParameter("@CustomerId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, customerId);
			parameters[2] = new SqlParameter("@TransportationPlanCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, transportationPlanCode);
			parameters[3] = new SqlParameter("@OrderStatus", SqlDbType.Int, 0, ParameterDirection.Input, true, 10, 0, "",  DataRowVersion.Current, orderStatus);
			parameters[4] = new SqlParameter("@RouteTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, routeTypeId);
			parameters[5] = new SqlParameter("@ReceivingOrderDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateStart);
			parameters[6] = new SqlParameter("@ReceivingOrderDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateEnd);
			parameters[7] = new SqlParameter("@GoodsShippedTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, goodsShippedTypeId);
			parameters[8] = new SqlParameter("@DeliveryCity", SqlDbType.NVarChar, 6, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, deliveryCity);
			parameters[9] = new SqlParameter("@AreaId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, areaId);

			// Call the stored proc.
			DataTable toReturn = new DataTable("QueryIssuingOrder");
			bool hasSucceeded = DbUtils.CallRetrievalStoredProcedure("[eLogitics].[dbo].[QueryIssuingOrder]", parameters, toReturn, null);

			return toReturn;
		}

	
		/// <summary>
		/// Calls stored procedure 'QueryIssuingOrder'. This version also returns the return value of the stored procedure.<br/><br/>
		/// 
		/// </summary>
		/// <param name="orderCode">Input parameter of stored procedure</param>
		/// <param name="customerId">Input parameter of stored procedure</param>
		/// <param name="transportationPlanCode">Input parameter of stored procedure</param>
		/// <param name="orderStatus">Input parameter of stored procedure</param>
		/// <param name="routeTypeId">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateStart">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateEnd">Input parameter of stored procedure</param>
		/// <param name="goodsShippedTypeId">Input parameter of stored procedure</param>
		/// <param name="deliveryCity">Input parameter of stored procedure</param>
		/// <param name="areaId">Input parameter of stored procedure</param>
		/// <param name="returnValue">Return value of the stored procedure</param>
		/// <returns>Filled DataTable with resultset(s) of stored procedure</returns>
		public static DataTable QueryIssuingOrder(System.String orderCode, System.Guid customerId, System.String transportationPlanCode, System.Int32 orderStatus, System.Guid routeTypeId, System.DateTime receivingOrderDateStart, System.DateTime receivingOrderDateEnd, System.Guid goodsShippedTypeId, System.String deliveryCity, System.Guid areaId, ref System.Int32 returnValue)
		{
			// create parameters. Add 1 to make room for the return value parameter.
			SqlParameter[] parameters = new SqlParameter[10 + 1];
			parameters[0] = new SqlParameter("@OrderCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, orderCode);
			parameters[1] = new SqlParameter("@CustomerId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, customerId);
			parameters[2] = new SqlParameter("@TransportationPlanCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, transportationPlanCode);
			parameters[3] = new SqlParameter("@OrderStatus", SqlDbType.Int, 0, ParameterDirection.Input, true, 10, 0, "",  DataRowVersion.Current, orderStatus);
			parameters[4] = new SqlParameter("@RouteTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, routeTypeId);
			parameters[5] = new SqlParameter("@ReceivingOrderDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateStart);
			parameters[6] = new SqlParameter("@ReceivingOrderDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateEnd);
			parameters[7] = new SqlParameter("@GoodsShippedTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, goodsShippedTypeId);
			parameters[8] = new SqlParameter("@DeliveryCity", SqlDbType.NVarChar, 6, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, deliveryCity);
			parameters[9] = new SqlParameter("@AreaId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, areaId);

			// return value parameter
			parameters[10] = new SqlParameter("RETURNVALUE", SqlDbType.Int, 0, ParameterDirection.ReturnValue, true, 10, 0, "",  DataRowVersion.Current, returnValue);
			
			// Call the stored proc.
			DataTable toReturn = new DataTable("QueryIssuingOrder");
			bool hasSucceeded = DbUtils.CallRetrievalStoredProcedure("[eLogitics].[dbo].[QueryIssuingOrder]", parameters, toReturn, null);


			returnValue = (int)parameters[10].Value;
			return toReturn;
		}


		/// <summary>
		/// Calls stored procedure 'QueryIssuingOrder'.<br/><br/>
		/// 
		/// </summary>
		/// <param name="orderCode">Input parameter of stored procedure</param>
		/// <param name="customerId">Input parameter of stored procedure</param>
		/// <param name="transportationPlanCode">Input parameter of stored procedure</param>
		/// <param name="orderStatus">Input parameter of stored procedure</param>
		/// <param name="routeTypeId">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateStart">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateEnd">Input parameter of stored procedure</param>
		/// <param name="goodsShippedTypeId">Input parameter of stored procedure</param>
		/// <param name="deliveryCity">Input parameter of stored procedure</param>
		/// <param name="areaId">Input parameter of stored procedure</param>
		/// <param name="transactionToUse">the transaction to use, or null if no transaction is available.</param>
		/// <returns>Filled DataTable with resultset(s) of stored procedure</returns>
		public static DataTable QueryIssuingOrder(System.String orderCode, System.Guid customerId, System.String transportationPlanCode, System.Int32 orderStatus, System.Guid routeTypeId, System.DateTime receivingOrderDateStart, System.DateTime receivingOrderDateEnd, System.Guid goodsShippedTypeId, System.String deliveryCity, System.Guid areaId,  ITransaction transactionToUse)
		{
			// create parameters
			SqlParameter[] parameters = new SqlParameter[10];
			parameters[0] = new SqlParameter("@OrderCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, orderCode);
			parameters[1] = new SqlParameter("@CustomerId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, customerId);
			parameters[2] = new SqlParameter("@TransportationPlanCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, transportationPlanCode);
			parameters[3] = new SqlParameter("@OrderStatus", SqlDbType.Int, 0, ParameterDirection.Input, true, 10, 0, "",  DataRowVersion.Current, orderStatus);
			parameters[4] = new SqlParameter("@RouteTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, routeTypeId);
			parameters[5] = new SqlParameter("@ReceivingOrderDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateStart);
			parameters[6] = new SqlParameter("@ReceivingOrderDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateEnd);
			parameters[7] = new SqlParameter("@GoodsShippedTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, goodsShippedTypeId);
			parameters[8] = new SqlParameter("@DeliveryCity", SqlDbType.NVarChar, 6, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, deliveryCity);
			parameters[9] = new SqlParameter("@AreaId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, areaId);

			// Call the stored proc.
			DataTable toReturn = new DataTable("QueryIssuingOrder");
			bool hasSucceeded = DbUtils.CallRetrievalStoredProcedure("[eLogitics].[dbo].[QueryIssuingOrder]", parameters, toReturn, transactionToUse);

			return toReturn;
		}

	
		/// <summary>
		/// Calls stored procedure 'QueryIssuingOrder'. This version also returns the return value of the stored procedure.<br/><br/>
		/// 
		/// </summary>
		/// <param name="orderCode">Input parameter of stored procedure</param>
		/// <param name="customerId">Input parameter of stored procedure</param>
		/// <param name="transportationPlanCode">Input parameter of stored procedure</param>
		/// <param name="orderStatus">Input parameter of stored procedure</param>
		/// <param name="routeTypeId">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateStart">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateEnd">Input parameter of stored procedure</param>
		/// <param name="goodsShippedTypeId">Input parameter of stored procedure</param>
		/// <param name="deliveryCity">Input parameter of stored procedure</param>
		/// <param name="areaId">Input parameter of stored procedure</param>
		/// <param name="returnValue">Return value of the stored procedure</param>
		/// <param name="transactionToUse">the transaction to use, or null if no transaction is available.</param>
		/// <returns>Filled DataTable with resultset(s) of stored procedure</returns>
		public static DataTable QueryIssuingOrder(System.String orderCode, System.Guid customerId, System.String transportationPlanCode, System.Int32 orderStatus, System.Guid routeTypeId, System.DateTime receivingOrderDateStart, System.DateTime receivingOrderDateEnd, System.Guid goodsShippedTypeId, System.String deliveryCity, System.Guid areaId, ref System.Int32 returnValue, ITransaction transactionToUse)
		{
			// create parameters. Add 1 to make room for the return value parameter.
			SqlParameter[] parameters = new SqlParameter[10 + 1];
			parameters[0] = new SqlParameter("@OrderCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, orderCode);
			parameters[1] = new SqlParameter("@CustomerId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, customerId);
			parameters[2] = new SqlParameter("@TransportationPlanCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, transportationPlanCode);
			parameters[3] = new SqlParameter("@OrderStatus", SqlDbType.Int, 0, ParameterDirection.Input, true, 10, 0, "",  DataRowVersion.Current, orderStatus);
			parameters[4] = new SqlParameter("@RouteTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, routeTypeId);
			parameters[5] = new SqlParameter("@ReceivingOrderDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateStart);
			parameters[6] = new SqlParameter("@ReceivingOrderDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateEnd);
			parameters[7] = new SqlParameter("@GoodsShippedTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, goodsShippedTypeId);
			parameters[8] = new SqlParameter("@DeliveryCity", SqlDbType.NVarChar, 6, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, deliveryCity);
			parameters[9] = new SqlParameter("@AreaId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, areaId);

			// return value parameter
			parameters[10] = new SqlParameter("RETURNVALUE", SqlDbType.Int, 0, ParameterDirection.ReturnValue, true, 10, 0, "",  DataRowVersion.Current, returnValue);
			
			// Call the stored proc.
			DataTable toReturn = new DataTable("QueryIssuingOrder");
			bool hasSucceeded = DbUtils.CallRetrievalStoredProcedure("[eLogitics].[dbo].[QueryIssuingOrder]", parameters, toReturn, transactionToUse);


			returnValue = (int)parameters[10].Value;
			return toReturn;
		}

		/// <summary>Creates an IRetrievalQuery object for a call to the procedure 'QueryIssuingOrder'.
		/// 
		/// </summary>
		/// <param name="orderCode">Input parameter of stored procedure</param>
		/// <param name="customerId">Input parameter of stored procedure</param>
		/// <param name="transportationPlanCode">Input parameter of stored procedure</param>
		/// <param name="orderStatus">Input parameter of stored procedure</param>
		/// <param name="routeTypeId">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateStart">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateEnd">Input parameter of stored procedure</param>
		/// <param name="goodsShippedTypeId">Input parameter of stored procedure</param>
		/// <param name="deliveryCity">Input parameter of stored procedure</param>
		/// <param name="areaId">Input parameter of stored procedure</param>
		/// <returns>IRetrievalQuery object which is ready to use for datafetching</returns>
		public static IRetrievalQuery GetQueryIssuingOrderCallAsQuery( System.String orderCode, System.Guid customerId, System.String transportationPlanCode, System.Int32 orderStatus, System.Guid routeTypeId, System.DateTime receivingOrderDateStart, System.DateTime receivingOrderDateEnd, System.Guid goodsShippedTypeId, System.String deliveryCity, System.Guid areaId)
		{
			string procName = SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine.GetNewStoredProcedureName("[eLogitics].[dbo].[QueryIssuingOrder]");
			RetrievalQuery toReturn = new RetrievalQuery( new SqlCommand(procName) );
			toReturn.Parameters.Add(new SqlParameter("@OrderCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, orderCode));
			toReturn.Parameters.Add(new SqlParameter("@CustomerId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, customerId));
			toReturn.Parameters.Add(new SqlParameter("@TransportationPlanCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, transportationPlanCode));
			toReturn.Parameters.Add(new SqlParameter("@OrderStatus", SqlDbType.Int, 0, ParameterDirection.Input, true, 10, 0, "",  DataRowVersion.Current, orderStatus));
			toReturn.Parameters.Add(new SqlParameter("@RouteTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, routeTypeId));
			toReturn.Parameters.Add(new SqlParameter("@ReceivingOrderDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateStart));
			toReturn.Parameters.Add(new SqlParameter("@ReceivingOrderDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateEnd));
			toReturn.Parameters.Add(new SqlParameter("@GoodsShippedTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, goodsShippedTypeId));
			toReturn.Parameters.Add(new SqlParameter("@DeliveryCity", SqlDbType.NVarChar, 6, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, deliveryCity));
			toReturn.Parameters.Add(new SqlParameter("@AreaId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, areaId));

			toReturn.Command.CommandType = CommandType.StoredProcedure;
			return toReturn;
		}
	

		/// <summary>
		/// Calls stored procedure 'QueryIssuingOrderDelivery'.<br/><br/>
		/// 
		/// </summary>
		/// <param name="orderCode">Input parameter of stored procedure</param>
		/// <param name="customerId">Input parameter of stored procedure</param>
		/// <param name="transportationPlanCode">Input parameter of stored procedure</param>
		/// <param name="orderStatus">Input parameter of stored procedure</param>
		/// <param name="routeTypeId">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateStart">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateEnd">Input parameter of stored procedure</param>
		/// <param name="goodsShippedTypeId">Input parameter of stored procedure</param>
		/// <param name="deliveryCity">Input parameter of stored procedure</param>
		/// <param name="areaId">Input parameter of stored procedure</param>
		/// <returns>Filled DataTable with resultset(s) of stored procedure</returns>
		public static DataTable QueryIssuingOrderDelivery(System.String orderCode, System.Guid customerId, System.String transportationPlanCode, System.Int32 orderStatus, System.Guid routeTypeId, System.DateTime receivingOrderDateStart, System.DateTime receivingOrderDateEnd, System.Guid goodsShippedTypeId, System.String deliveryCity, System.Guid areaId)
		{
			// create parameters
			SqlParameter[] parameters = new SqlParameter[10];
			parameters[0] = new SqlParameter("@OrderCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, orderCode);
			parameters[1] = new SqlParameter("@CustomerId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, customerId);
			parameters[2] = new SqlParameter("@TransportationPlanCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, transportationPlanCode);
			parameters[3] = new SqlParameter("@OrderStatus", SqlDbType.Int, 0, ParameterDirection.Input, true, 10, 0, "",  DataRowVersion.Current, orderStatus);
			parameters[4] = new SqlParameter("@RouteTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, routeTypeId);
			parameters[5] = new SqlParameter("@ReceivingOrderDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateStart);
			parameters[6] = new SqlParameter("@ReceivingOrderDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateEnd);
			parameters[7] = new SqlParameter("@GoodsShippedTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, goodsShippedTypeId);
			parameters[8] = new SqlParameter("@DeliveryCity", SqlDbType.NVarChar, 6, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, deliveryCity);
			parameters[9] = new SqlParameter("@AreaId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, areaId);

			// Call the stored proc.
			DataTable toReturn = new DataTable("QueryIssuingOrderDelivery");
			bool hasSucceeded = DbUtils.CallRetrievalStoredProcedure("[eLogitics].[dbo].[QueryIssuingOrderDelivery]", parameters, toReturn, null);

			return toReturn;
		}

	
		/// <summary>
		/// Calls stored procedure 'QueryIssuingOrderDelivery'. This version also returns the return value of the stored procedure.<br/><br/>
		/// 
		/// </summary>
		/// <param name="orderCode">Input parameter of stored procedure</param>
		/// <param name="customerId">Input parameter of stored procedure</param>
		/// <param name="transportationPlanCode">Input parameter of stored procedure</param>
		/// <param name="orderStatus">Input parameter of stored procedure</param>
		/// <param name="routeTypeId">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateStart">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateEnd">Input parameter of stored procedure</param>
		/// <param name="goodsShippedTypeId">Input parameter of stored procedure</param>
		/// <param name="deliveryCity">Input parameter of stored procedure</param>
		/// <param name="areaId">Input parameter of stored procedure</param>
		/// <param name="returnValue">Return value of the stored procedure</param>
		/// <returns>Filled DataTable with resultset(s) of stored procedure</returns>
		public static DataTable QueryIssuingOrderDelivery(System.String orderCode, System.Guid customerId, System.String transportationPlanCode, System.Int32 orderStatus, System.Guid routeTypeId, System.DateTime receivingOrderDateStart, System.DateTime receivingOrderDateEnd, System.Guid goodsShippedTypeId, System.String deliveryCity, System.Guid areaId, ref System.Int32 returnValue)
		{
			// create parameters. Add 1 to make room for the return value parameter.
			SqlParameter[] parameters = new SqlParameter[10 + 1];
			parameters[0] = new SqlParameter("@OrderCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, orderCode);
			parameters[1] = new SqlParameter("@CustomerId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, customerId);
			parameters[2] = new SqlParameter("@TransportationPlanCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, transportationPlanCode);
			parameters[3] = new SqlParameter("@OrderStatus", SqlDbType.Int, 0, ParameterDirection.Input, true, 10, 0, "",  DataRowVersion.Current, orderStatus);
			parameters[4] = new SqlParameter("@RouteTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, routeTypeId);
			parameters[5] = new SqlParameter("@ReceivingOrderDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateStart);
			parameters[6] = new SqlParameter("@ReceivingOrderDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateEnd);
			parameters[7] = new SqlParameter("@GoodsShippedTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, goodsShippedTypeId);
			parameters[8] = new SqlParameter("@DeliveryCity", SqlDbType.NVarChar, 6, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, deliveryCity);
			parameters[9] = new SqlParameter("@AreaId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, areaId);

			// return value parameter
			parameters[10] = new SqlParameter("RETURNVALUE", SqlDbType.Int, 0, ParameterDirection.ReturnValue, true, 10, 0, "",  DataRowVersion.Current, returnValue);
			
			// Call the stored proc.
			DataTable toReturn = new DataTable("QueryIssuingOrderDelivery");
			bool hasSucceeded = DbUtils.CallRetrievalStoredProcedure("[eLogitics].[dbo].[QueryIssuingOrderDelivery]", parameters, toReturn, null);


			returnValue = (int)parameters[10].Value;
			return toReturn;
		}


		/// <summary>
		/// Calls stored procedure 'QueryIssuingOrderDelivery'.<br/><br/>
		/// 
		/// </summary>
		/// <param name="orderCode">Input parameter of stored procedure</param>
		/// <param name="customerId">Input parameter of stored procedure</param>
		/// <param name="transportationPlanCode">Input parameter of stored procedure</param>
		/// <param name="orderStatus">Input parameter of stored procedure</param>
		/// <param name="routeTypeId">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateStart">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateEnd">Input parameter of stored procedure</param>
		/// <param name="goodsShippedTypeId">Input parameter of stored procedure</param>
		/// <param name="deliveryCity">Input parameter of stored procedure</param>
		/// <param name="areaId">Input parameter of stored procedure</param>
		/// <param name="transactionToUse">the transaction to use, or null if no transaction is available.</param>
		/// <returns>Filled DataTable with resultset(s) of stored procedure</returns>
		public static DataTable QueryIssuingOrderDelivery(System.String orderCode, System.Guid customerId, System.String transportationPlanCode, System.Int32 orderStatus, System.Guid routeTypeId, System.DateTime receivingOrderDateStart, System.DateTime receivingOrderDateEnd, System.Guid goodsShippedTypeId, System.String deliveryCity, System.Guid areaId,  ITransaction transactionToUse)
		{
			// create parameters
			SqlParameter[] parameters = new SqlParameter[10];
			parameters[0] = new SqlParameter("@OrderCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, orderCode);
			parameters[1] = new SqlParameter("@CustomerId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, customerId);
			parameters[2] = new SqlParameter("@TransportationPlanCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, transportationPlanCode);
			parameters[3] = new SqlParameter("@OrderStatus", SqlDbType.Int, 0, ParameterDirection.Input, true, 10, 0, "",  DataRowVersion.Current, orderStatus);
			parameters[4] = new SqlParameter("@RouteTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, routeTypeId);
			parameters[5] = new SqlParameter("@ReceivingOrderDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateStart);
			parameters[6] = new SqlParameter("@ReceivingOrderDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateEnd);
			parameters[7] = new SqlParameter("@GoodsShippedTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, goodsShippedTypeId);
			parameters[8] = new SqlParameter("@DeliveryCity", SqlDbType.NVarChar, 6, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, deliveryCity);
			parameters[9] = new SqlParameter("@AreaId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, areaId);

			// Call the stored proc.
			DataTable toReturn = new DataTable("QueryIssuingOrderDelivery");
			bool hasSucceeded = DbUtils.CallRetrievalStoredProcedure("[eLogitics].[dbo].[QueryIssuingOrderDelivery]", parameters, toReturn, transactionToUse);

			return toReturn;
		}

	
		/// <summary>
		/// Calls stored procedure 'QueryIssuingOrderDelivery'. This version also returns the return value of the stored procedure.<br/><br/>
		/// 
		/// </summary>
		/// <param name="orderCode">Input parameter of stored procedure</param>
		/// <param name="customerId">Input parameter of stored procedure</param>
		/// <param name="transportationPlanCode">Input parameter of stored procedure</param>
		/// <param name="orderStatus">Input parameter of stored procedure</param>
		/// <param name="routeTypeId">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateStart">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateEnd">Input parameter of stored procedure</param>
		/// <param name="goodsShippedTypeId">Input parameter of stored procedure</param>
		/// <param name="deliveryCity">Input parameter of stored procedure</param>
		/// <param name="areaId">Input parameter of stored procedure</param>
		/// <param name="returnValue">Return value of the stored procedure</param>
		/// <param name="transactionToUse">the transaction to use, or null if no transaction is available.</param>
		/// <returns>Filled DataTable with resultset(s) of stored procedure</returns>
		public static DataTable QueryIssuingOrderDelivery(System.String orderCode, System.Guid customerId, System.String transportationPlanCode, System.Int32 orderStatus, System.Guid routeTypeId, System.DateTime receivingOrderDateStart, System.DateTime receivingOrderDateEnd, System.Guid goodsShippedTypeId, System.String deliveryCity, System.Guid areaId, ref System.Int32 returnValue, ITransaction transactionToUse)
		{
			// create parameters. Add 1 to make room for the return value parameter.
			SqlParameter[] parameters = new SqlParameter[10 + 1];
			parameters[0] = new SqlParameter("@OrderCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, orderCode);
			parameters[1] = new SqlParameter("@CustomerId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, customerId);
			parameters[2] = new SqlParameter("@TransportationPlanCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, transportationPlanCode);
			parameters[3] = new SqlParameter("@OrderStatus", SqlDbType.Int, 0, ParameterDirection.Input, true, 10, 0, "",  DataRowVersion.Current, orderStatus);
			parameters[4] = new SqlParameter("@RouteTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, routeTypeId);
			parameters[5] = new SqlParameter("@ReceivingOrderDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateStart);
			parameters[6] = new SqlParameter("@ReceivingOrderDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateEnd);
			parameters[7] = new SqlParameter("@GoodsShippedTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, goodsShippedTypeId);
			parameters[8] = new SqlParameter("@DeliveryCity", SqlDbType.NVarChar, 6, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, deliveryCity);
			parameters[9] = new SqlParameter("@AreaId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, areaId);

			// return value parameter
			parameters[10] = new SqlParameter("RETURNVALUE", SqlDbType.Int, 0, ParameterDirection.ReturnValue, true, 10, 0, "",  DataRowVersion.Current, returnValue);
			
			// Call the stored proc.
			DataTable toReturn = new DataTable("QueryIssuingOrderDelivery");
			bool hasSucceeded = DbUtils.CallRetrievalStoredProcedure("[eLogitics].[dbo].[QueryIssuingOrderDelivery]", parameters, toReturn, transactionToUse);


			returnValue = (int)parameters[10].Value;
			return toReturn;
		}

		/// <summary>Creates an IRetrievalQuery object for a call to the procedure 'QueryIssuingOrderDelivery'.
		/// 
		/// </summary>
		/// <param name="orderCode">Input parameter of stored procedure</param>
		/// <param name="customerId">Input parameter of stored procedure</param>
		/// <param name="transportationPlanCode">Input parameter of stored procedure</param>
		/// <param name="orderStatus">Input parameter of stored procedure</param>
		/// <param name="routeTypeId">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateStart">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateEnd">Input parameter of stored procedure</param>
		/// <param name="goodsShippedTypeId">Input parameter of stored procedure</param>
		/// <param name="deliveryCity">Input parameter of stored procedure</param>
		/// <param name="areaId">Input parameter of stored procedure</param>
		/// <returns>IRetrievalQuery object which is ready to use for datafetching</returns>
		public static IRetrievalQuery GetQueryIssuingOrderDeliveryCallAsQuery( System.String orderCode, System.Guid customerId, System.String transportationPlanCode, System.Int32 orderStatus, System.Guid routeTypeId, System.DateTime receivingOrderDateStart, System.DateTime receivingOrderDateEnd, System.Guid goodsShippedTypeId, System.String deliveryCity, System.Guid areaId)
		{
			string procName = SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine.GetNewStoredProcedureName("[eLogitics].[dbo].[QueryIssuingOrderDelivery]");
			RetrievalQuery toReturn = new RetrievalQuery( new SqlCommand(procName) );
			toReturn.Parameters.Add(new SqlParameter("@OrderCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, orderCode));
			toReturn.Parameters.Add(new SqlParameter("@CustomerId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, customerId));
			toReturn.Parameters.Add(new SqlParameter("@TransportationPlanCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, transportationPlanCode));
			toReturn.Parameters.Add(new SqlParameter("@OrderStatus", SqlDbType.Int, 0, ParameterDirection.Input, true, 10, 0, "",  DataRowVersion.Current, orderStatus));
			toReturn.Parameters.Add(new SqlParameter("@RouteTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, routeTypeId));
			toReturn.Parameters.Add(new SqlParameter("@ReceivingOrderDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateStart));
			toReturn.Parameters.Add(new SqlParameter("@ReceivingOrderDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateEnd));
			toReturn.Parameters.Add(new SqlParameter("@GoodsShippedTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, goodsShippedTypeId));
			toReturn.Parameters.Add(new SqlParameter("@DeliveryCity", SqlDbType.NVarChar, 6, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, deliveryCity));
			toReturn.Parameters.Add(new SqlParameter("@AreaId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, areaId));

			toReturn.Command.CommandType = CommandType.StoredProcedure;
			return toReturn;
		}
	

		/// <summary>
		/// Calls stored procedure 'QueryShuntingTrackInfo'.<br/><br/>
		/// 
		/// </summary>
		/// <param name="orderCode">Input parameter of stored procedure</param>
		/// <param name="customerId">Input parameter of stored procedure</param>
		/// <param name="transportationPlanCode">Input parameter of stored procedure</param>
		/// <param name="orderStatus">Input parameter of stored procedure</param>
		/// <param name="routeTypeId">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateStart">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateEnd">Input parameter of stored procedure</param>
		/// <param name="goodsShippedTypeId">Input parameter of stored procedure</param>
		/// <param name="deliveryCity">Input parameter of stored procedure</param>
		/// <param name="areaId">Input parameter of stored procedure</param>
		/// <param name="plannedShippingDateStart">Input parameter of stored procedure</param>
		/// <param name="plannedShippingDateEnd">Input parameter of stored procedure</param>
		/// <param name="shuntingPerson">Input parameter of stored procedure</param>
		/// <returns>Filled DataTable with resultset(s) of stored procedure</returns>
		public static DataTable QueryShuntingTrackInfo(System.String orderCode, System.Guid customerId, System.String transportationPlanCode, System.Int32 orderStatus, System.Guid routeTypeId, System.DateTime receivingOrderDateStart, System.DateTime receivingOrderDateEnd, System.Guid goodsShippedTypeId, System.String deliveryCity, System.Guid areaId, System.DateTime plannedShippingDateStart,  
System.DateTime plannedShippingDateEnd, System.Guid shuntingPerson)
		{
			// create parameters
			SqlParameter[] parameters = new SqlParameter[13];
			parameters[0] = new SqlParameter("@OrderCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, orderCode);
			parameters[1] = new SqlParameter("@CustomerId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, customerId);
			parameters[2] = new SqlParameter("@TransportationPlanCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, transportationPlanCode);
			parameters[3] = new SqlParameter("@OrderStatus", SqlDbType.Int, 0, ParameterDirection.Input, true, 10, 0, "",  DataRowVersion.Current, orderStatus);
			parameters[4] = new SqlParameter("@RouteTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, routeTypeId);
			parameters[5] = new SqlParameter("@ReceivingOrderDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateStart);
			parameters[6] = new SqlParameter("@ReceivingOrderDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateEnd);
			parameters[7] = new SqlParameter("@GoodsShippedTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, goodsShippedTypeId);
			parameters[8] = new SqlParameter("@DeliveryCity", SqlDbType.NVarChar, 6, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, deliveryCity);
			parameters[9] = new SqlParameter("@AreaId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, areaId);
			parameters[10] = new SqlParameter("@PlannedShippingDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, plannedShippingDateStart);
			parameters[11] = new SqlParameter("@PlannedShippingDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, plannedShippingDateEnd);
			parameters[12] = new SqlParameter("@ShuntingPerson", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, shuntingPerson);

			// Call the stored proc.
			DataTable toReturn = new DataTable("QueryShuntingTrackInfo");
			bool hasSucceeded = DbUtils.CallRetrievalStoredProcedure("[eLogitics].[dbo].[QueryShuntingTrackInfo]", parameters, toReturn, null);

			return toReturn;
		}

	
		/// <summary>
		/// Calls stored procedure 'QueryShuntingTrackInfo'. This version also returns the return value of the stored procedure.<br/><br/>
		/// 
		/// </summary>
		/// <param name="orderCode">Input parameter of stored procedure</param>
		/// <param name="customerId">Input parameter of stored procedure</param>
		/// <param name="transportationPlanCode">Input parameter of stored procedure</param>
		/// <param name="orderStatus">Input parameter of stored procedure</param>
		/// <param name="routeTypeId">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateStart">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateEnd">Input parameter of stored procedure</param>
		/// <param name="goodsShippedTypeId">Input parameter of stored procedure</param>
		/// <param name="deliveryCity">Input parameter of stored procedure</param>
		/// <param name="areaId">Input parameter of stored procedure</param>
		/// <param name="plannedShippingDateStart">Input parameter of stored procedure</param>
		/// <param name="plannedShippingDateEnd">Input parameter of stored procedure</param>
		/// <param name="shuntingPerson">Input parameter of stored procedure</param>
		/// <param name="returnValue">Return value of the stored procedure</param>
		/// <returns>Filled DataTable with resultset(s) of stored procedure</returns>
		public static DataTable QueryShuntingTrackInfo(System.String orderCode, System.Guid customerId, System.String transportationPlanCode, System.Int32 orderStatus, System.Guid routeTypeId, System.DateTime receivingOrderDateStart, System.DateTime receivingOrderDateEnd, System.Guid goodsShippedTypeId, System.String deliveryCity, System.Guid areaId, System.DateTime plannedShippingDateStart,  
System.DateTime plannedShippingDateEnd, System.Guid shuntingPerson, ref System.Int32 returnValue)
		{
			// create parameters. Add 1 to make room for the return value parameter.
			SqlParameter[] parameters = new SqlParameter[13 + 1];
			parameters[0] = new SqlParameter("@OrderCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, orderCode);
			parameters[1] = new SqlParameter("@CustomerId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, customerId);
			parameters[2] = new SqlParameter("@TransportationPlanCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, transportationPlanCode);
			parameters[3] = new SqlParameter("@OrderStatus", SqlDbType.Int, 0, ParameterDirection.Input, true, 10, 0, "",  DataRowVersion.Current, orderStatus);
			parameters[4] = new SqlParameter("@RouteTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, routeTypeId);
			parameters[5] = new SqlParameter("@ReceivingOrderDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateStart);
			parameters[6] = new SqlParameter("@ReceivingOrderDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateEnd);
			parameters[7] = new SqlParameter("@GoodsShippedTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, goodsShippedTypeId);
			parameters[8] = new SqlParameter("@DeliveryCity", SqlDbType.NVarChar, 6, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, deliveryCity);
			parameters[9] = new SqlParameter("@AreaId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, areaId);
			parameters[10] = new SqlParameter("@PlannedShippingDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, plannedShippingDateStart);
			parameters[11] = new SqlParameter("@PlannedShippingDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, plannedShippingDateEnd);
			parameters[12] = new SqlParameter("@ShuntingPerson", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, shuntingPerson);

			// return value parameter
			parameters[13] = new SqlParameter("RETURNVALUE", SqlDbType.Int, 0, ParameterDirection.ReturnValue, true, 10, 0, "",  DataRowVersion.Current, returnValue);
			
			// Call the stored proc.
			DataTable toReturn = new DataTable("QueryShuntingTrackInfo");
			bool hasSucceeded = DbUtils.CallRetrievalStoredProcedure("[eLogitics].[dbo].[QueryShuntingTrackInfo]", parameters, toReturn, null);


			returnValue = (int)parameters[13].Value;
			return toReturn;
		}


		/// <summary>
		/// Calls stored procedure 'QueryShuntingTrackInfo'.<br/><br/>
		/// 
		/// </summary>
		/// <param name="orderCode">Input parameter of stored procedure</param>
		/// <param name="customerId">Input parameter of stored procedure</param>
		/// <param name="transportationPlanCode">Input parameter of stored procedure</param>
		/// <param name="orderStatus">Input parameter of stored procedure</param>
		/// <param name="routeTypeId">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateStart">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateEnd">Input parameter of stored procedure</param>
		/// <param name="goodsShippedTypeId">Input parameter of stored procedure</param>
		/// <param name="deliveryCity">Input parameter of stored procedure</param>
		/// <param name="areaId">Input parameter of stored procedure</param>
		/// <param name="plannedShippingDateStart">Input parameter of stored procedure</param>
		/// <param name="plannedShippingDateEnd">Input parameter of stored procedure</param>
		/// <param name="shuntingPerson">Input parameter of stored procedure</param>
		/// <param name="transactionToUse">the transaction to use, or null if no transaction is available.</param>
		/// <returns>Filled DataTable with resultset(s) of stored procedure</returns>
		public static DataTable QueryShuntingTrackInfo(System.String orderCode, System.Guid customerId, System.String transportationPlanCode, System.Int32 orderStatus, System.Guid routeTypeId, System.DateTime receivingOrderDateStart, System.DateTime receivingOrderDateEnd, System.Guid goodsShippedTypeId, System.String deliveryCity, System.Guid areaId, System.DateTime plannedShippingDateStart,  
System.DateTime plannedShippingDateEnd, System.Guid shuntingPerson,  ITransaction transactionToUse)
		{
			// create parameters
			SqlParameter[] parameters = new SqlParameter[13];
			parameters[0] = new SqlParameter("@OrderCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, orderCode);
			parameters[1] = new SqlParameter("@CustomerId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, customerId);
			parameters[2] = new SqlParameter("@TransportationPlanCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, transportationPlanCode);
			parameters[3] = new SqlParameter("@OrderStatus", SqlDbType.Int, 0, ParameterDirection.Input, true, 10, 0, "",  DataRowVersion.Current, orderStatus);
			parameters[4] = new SqlParameter("@RouteTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, routeTypeId);
			parameters[5] = new SqlParameter("@ReceivingOrderDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateStart);
			parameters[6] = new SqlParameter("@ReceivingOrderDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateEnd);
			parameters[7] = new SqlParameter("@GoodsShippedTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, goodsShippedTypeId);
			parameters[8] = new SqlParameter("@DeliveryCity", SqlDbType.NVarChar, 6, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, deliveryCity);
			parameters[9] = new SqlParameter("@AreaId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, areaId);
			parameters[10] = new SqlParameter("@PlannedShippingDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, plannedShippingDateStart);
			parameters[11] = new SqlParameter("@PlannedShippingDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, plannedShippingDateEnd);
			parameters[12] = new SqlParameter("@ShuntingPerson", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, shuntingPerson);

			// Call the stored proc.
			DataTable toReturn = new DataTable("QueryShuntingTrackInfo");
			bool hasSucceeded = DbUtils.CallRetrievalStoredProcedure("[eLogitics].[dbo].[QueryShuntingTrackInfo]", parameters, toReturn, transactionToUse);

			return toReturn;
		}

	
		/// <summary>
		/// Calls stored procedure 'QueryShuntingTrackInfo'. This version also returns the return value of the stored procedure.<br/><br/>
		/// 
		/// </summary>
		/// <param name="orderCode">Input parameter of stored procedure</param>
		/// <param name="customerId">Input parameter of stored procedure</param>
		/// <param name="transportationPlanCode">Input parameter of stored procedure</param>
		/// <param name="orderStatus">Input parameter of stored procedure</param>
		/// <param name="routeTypeId">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateStart">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateEnd">Input parameter of stored procedure</param>
		/// <param name="goodsShippedTypeId">Input parameter of stored procedure</param>
		/// <param name="deliveryCity">Input parameter of stored procedure</param>
		/// <param name="areaId">Input parameter of stored procedure</param>
		/// <param name="plannedShippingDateStart">Input parameter of stored procedure</param>
		/// <param name="plannedShippingDateEnd">Input parameter of stored procedure</param>
		/// <param name="shuntingPerson">Input parameter of stored procedure</param>
		/// <param name="returnValue">Return value of the stored procedure</param>
		/// <param name="transactionToUse">the transaction to use, or null if no transaction is available.</param>
		/// <returns>Filled DataTable with resultset(s) of stored procedure</returns>
		public static DataTable QueryShuntingTrackInfo(System.String orderCode, System.Guid customerId, System.String transportationPlanCode, System.Int32 orderStatus, System.Guid routeTypeId, System.DateTime receivingOrderDateStart, System.DateTime receivingOrderDateEnd, System.Guid goodsShippedTypeId, System.String deliveryCity, System.Guid areaId, System.DateTime plannedShippingDateStart,  
System.DateTime plannedShippingDateEnd, System.Guid shuntingPerson, ref System.Int32 returnValue, ITransaction transactionToUse)
		{
			// create parameters. Add 1 to make room for the return value parameter.
			SqlParameter[] parameters = new SqlParameter[13 + 1];
			parameters[0] = new SqlParameter("@OrderCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, orderCode);
			parameters[1] = new SqlParameter("@CustomerId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, customerId);
			parameters[2] = new SqlParameter("@TransportationPlanCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, transportationPlanCode);
			parameters[3] = new SqlParameter("@OrderStatus", SqlDbType.Int, 0, ParameterDirection.Input, true, 10, 0, "",  DataRowVersion.Current, orderStatus);
			parameters[4] = new SqlParameter("@RouteTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, routeTypeId);
			parameters[5] = new SqlParameter("@ReceivingOrderDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateStart);
			parameters[6] = new SqlParameter("@ReceivingOrderDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateEnd);
			parameters[7] = new SqlParameter("@GoodsShippedTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, goodsShippedTypeId);
			parameters[8] = new SqlParameter("@DeliveryCity", SqlDbType.NVarChar, 6, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, deliveryCity);
			parameters[9] = new SqlParameter("@AreaId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, areaId);
			parameters[10] = new SqlParameter("@PlannedShippingDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, plannedShippingDateStart);
			parameters[11] = new SqlParameter("@PlannedShippingDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, plannedShippingDateEnd);
			parameters[12] = new SqlParameter("@ShuntingPerson", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, shuntingPerson);

			// return value parameter
			parameters[13] = new SqlParameter("RETURNVALUE", SqlDbType.Int, 0, ParameterDirection.ReturnValue, true, 10, 0, "",  DataRowVersion.Current, returnValue);
			
			// Call the stored proc.
			DataTable toReturn = new DataTable("QueryShuntingTrackInfo");
			bool hasSucceeded = DbUtils.CallRetrievalStoredProcedure("[eLogitics].[dbo].[QueryShuntingTrackInfo]", parameters, toReturn, transactionToUse);


			returnValue = (int)parameters[13].Value;
			return toReturn;
		}

		/// <summary>Creates an IRetrievalQuery object for a call to the procedure 'QueryShuntingTrackInfo'.
		/// 
		/// </summary>
		/// <param name="orderCode">Input parameter of stored procedure</param>
		/// <param name="customerId">Input parameter of stored procedure</param>
		/// <param name="transportationPlanCode">Input parameter of stored procedure</param>
		/// <param name="orderStatus">Input parameter of stored procedure</param>
		/// <param name="routeTypeId">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateStart">Input parameter of stored procedure</param>
		/// <param name="receivingOrderDateEnd">Input parameter of stored procedure</param>
		/// <param name="goodsShippedTypeId">Input parameter of stored procedure</param>
		/// <param name="deliveryCity">Input parameter of stored procedure</param>
		/// <param name="areaId">Input parameter of stored procedure</param>
		/// <param name="plannedShippingDateStart">Input parameter of stored procedure</param>
		/// <param name="plannedShippingDateEnd">Input parameter of stored procedure</param>
		/// <param name="shuntingPerson">Input parameter of stored procedure</param>
		/// <returns>IRetrievalQuery object which is ready to use for datafetching</returns>
		public static IRetrievalQuery GetQueryShuntingTrackInfoCallAsQuery( System.String orderCode, System.Guid customerId, System.String transportationPlanCode, System.Int32 orderStatus, System.Guid routeTypeId, System.DateTime receivingOrderDateStart, System.DateTime receivingOrderDateEnd, System.Guid goodsShippedTypeId, System.String deliveryCity, System.Guid areaId, System.DateTime plannedShippingDateStart,  
System.DateTime plannedShippingDateEnd, System.Guid shuntingPerson)
		{
			string procName = SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine.GetNewStoredProcedureName("[eLogitics].[dbo].[QueryShuntingTrackInfo]");
			RetrievalQuery toReturn = new RetrievalQuery( new SqlCommand(procName) );
			toReturn.Parameters.Add(new SqlParameter("@OrderCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, orderCode));
			toReturn.Parameters.Add(new SqlParameter("@CustomerId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, customerId));
			toReturn.Parameters.Add(new SqlParameter("@TransportationPlanCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, transportationPlanCode));
			toReturn.Parameters.Add(new SqlParameter("@OrderStatus", SqlDbType.Int, 0, ParameterDirection.Input, true, 10, 0, "",  DataRowVersion.Current, orderStatus));
			toReturn.Parameters.Add(new SqlParameter("@RouteTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, routeTypeId));
			toReturn.Parameters.Add(new SqlParameter("@ReceivingOrderDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateStart));
			toReturn.Parameters.Add(new SqlParameter("@ReceivingOrderDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, receivingOrderDateEnd));
			toReturn.Parameters.Add(new SqlParameter("@GoodsShippedTypeId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, goodsShippedTypeId));
			toReturn.Parameters.Add(new SqlParameter("@DeliveryCity", SqlDbType.NVarChar, 6, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, deliveryCity));
			toReturn.Parameters.Add(new SqlParameter("@AreaId", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, areaId));
			toReturn.Parameters.Add(new SqlParameter("@PlannedShippingDateStart", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, plannedShippingDateStart));
			toReturn.Parameters.Add(new SqlParameter("@PlannedShippingDateEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, plannedShippingDateEnd));
			toReturn.Parameters.Add(new SqlParameter("@ShuntingPerson", SqlDbType.UniqueIdentifier, 0, ParameterDirection.Input, true, 0, 0, "",  DataRowVersion.Current, shuntingPerson));

			toReturn.Command.CommandType = CommandType.StoredProcedure;
			return toReturn;
		}
	

		#region Included Code

		#endregion
	}
}
